correct_username = 'kate'
correct_password = '666666'
max_attempts = 3
for attempt in range(max_attempts):
    username = input("请输入用户名：")
    password = input("请输入密码：")
    if username == correct_username and password == correct_password:
        print("登录成功！")
        exit()  
    else:
        remaining = max_attempts - (attempt + 1)
        if remaining > 0:
            print(f"用户名或密码错误，还有{remaining}次机会，请重新输入。")
print("3次用户名或者密码均有误!退出程序。")